define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {

    var Controller = {
        index: function () {
            $(document).on('change','input[name="row[to_destination_range_switch]"]',function (){
                var type=$(this).val();
                switch (type){
                    case "normal":
                        $('.to_destination_range_metre').removeClass('hide');
                        break;
                    case "hidden":
                        $('.to_destination_range_metre').addClass('hide');
                        $('#c-to_destination_range_metre').val('');
                        break;

                }
            });
            Controller.api.bindevent();
        },
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            }
        }
    };
    return Controller;
});
